<?php
/**********************************************************
 *
 * 	Load all the javascript file
 *
 **********************************************************/
   
    // this is for use in the javascript to refer to some absolute path
    $edp_domain_url = EDP_DOMAIN;
    $edp_static_domain_url = STATIC_DOMAIN;
    $WebUI = GetWebUI();
    $uiscript = $WebUI->OutputScripts();
    $hasLogin = GetLoginUserID() == false ? "false" : "true";
   
    echo <<< EDPTAG
		<script type="text/javascript">
			var edp_domain_url = "$edp_domain_url";
            var edp_static_domain_url = "$edp_static_domain_url";
			var hasLogin = $hasLogin;
		</script>
EDPTAG;

	echo '<script type="text/javascript" src="' . JS_DIR . 'common.js?v=' . EDPGetResourceVersion( 'common.js' ) . '"></script>' . "\n";
	
	if( $uiscript != '' ){
	echo <<< EDPTAG
	<script>$(document).ready(function(){{$uiscript}});</script>
EDPTAG;
	}
	
	
	echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.js.php?v=' . EDPGetResourceVersion( "lib/jquery.js.php" ) .'"></script>';
	
	if( file_exists( STATIC_DIR . 'js/' . $page_base . '.js.php' ) )
		echo '<script type="text/javascript" src="' . JS_DIR . $page_base . '.js.php?v=' . EDPGetResourceVersion( $page_base . '.js.php' ) . '"></script>' . "\n";
	else if( file_exists( STATIC_DIR . 'js/' . $page_base . '.js' ) )
		echo '<script type="text/javascript" src="' . JS_DIR . $page_base . '.js?v=' . EDPGetResourceVersion( $page_base . '.js' ) . '"></script>' . "\n";
	


?>

<!--[if IE 6]>
<script type="text/javascript" src="<?php echo JS_DIR . 'lib/DD_belatedPNG_0.0.8a-min.js';?>"></script>
<script>
DD_belatedPNG.fix('.searchbar_left', 'background');
DD_belatedPNG.fix('.searchbar_right', 'background');
</script>
<![endif]--> 

<?php


//echo 'common header ';
//echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.autocomplete.min.js"></script>';
//echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.bigframe.min.js"></script>';
//echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.bgiframe.min.js"></script> ';
//echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.ajaxQueue.js"></script> ';
//echo '<link rel="stylesheet" type="text/css" href="' . CSS_DIR . 'jquery.autocomplete.css" /> ';
//echo '<script type="text/javascript" src="' . JS_DIR . 'suggestion.js"></script>';
//echo '<script type="text/javascript" src="' . JS_DIR . 'lib/jquery.lazyload.js"></script>';

?>

<script type="text/javascript">
$(document).ready(function(){
	CommitHandler();
});
</script>